<%- content_for(:head) do -%>
  <title>::NoiseTube:: User <%= @user.login  %> :: Digital traces of my exposure to pollution</title>
  <!-- <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAEDqSJ7sjOq1o3M9HFMUctBT0NiLLVHrVqet-Tka_0tk-YB2j8RThZNhTM6xrex3wBLzNXKA57-KJww"
          type="text/javascript"></script> -->

  <link rel="alternate" type="application/rss+xml" title="RSS" href="<%= user_url(@user, :format=>:rss)%>" />
<% end %>


<div style="float:left;width:250px">
  <div id="summary">
    <p>
      <%= image_tag @user.image_url().to_s, :width=>50, :title=>"#{@user.login} (#{@user.role if @user.role.nil?})" %>
      <br/><b> <%= @user.login   %></b>
    </p>
    <p><img src="/images/icons/Activity-Monitor_32x32.png" align="absmiddle" alt="Activity"/>&nbsp;<b><%= t 'cartasur.users.show.activity' %></b>
      <br/><%= t 'cartasur.users.show.last' %>: <%= distance_of_time_in_words(@summary[:last_activity], Time.now) unless @summary[:last_activity].nil? %> <%= t 'cartasur.users.show.ago' %>
      <br/><%= t 'cartasur.users.show.totameasurements' %>: <%= @summary[:measures_size] %>
    </p>
    <p/>
    <% if logged_in? && @user==current_user %>
      <p>
        <a href="/cartasur/users/<%= @user.id %>/uploaddata"><img src="/images/icons/Upload_32x32.png" align="absmiddle" alt="Upload"/>&nbsp;<b><%= t 'cartasur.users.show.uploaddata' %></b></a>
        <% if flash[:upload_notice] %>
          <div class="notice" style="color: green;"><%= flash[:upload_notice] %><br/></div>
        <% end %>
      </p>
    <% end %>
    <p>
      <img src="/images/icons/tag.png" align="absmiddle" alt="Tags"/>&nbsp;<b><%= t 'cartasur.users.show.semanticprofile' %>: </b><br/>

      <p><%= t 'cartasur.users.show.locations' %>:<br/>
      <% unless @tags_location.blank?
        tag_cloud @tags_location, %w(tag1 tag2 tag3 tag4) do |tag, css_class| %>
          <%= link_to "#{tag.name}", {:controller=>:tags, :action=>:filter, :tags => "location:#{tag.name}"}, :class => css_class, :title=>"#{tag.count} tags" %>,
        <% end
      end %></p>
      <p><%= t 'cartasur.users.show.time' %>:<br/>
      <% unless @tags_time.blank?
        tag_cloud @tags_time, %w(tag1 tag2 tag3 tag4) do |tag, css_class| %>
          <%= link_to "#{tag.name}", {:controller=>:tags, :action=>:filter, :tags => "time:#{tag.name}"}, :class => css_class, :title=>"#{tag.count} tags" %>,
        <% end
      end %></p>
      <p><%= t 'cartasur.users.show.noiseexposure' %>: <br/>
      <% unless @tags_loudness.blank?
        tag_cloud @tags_loudness, %w(tag1 tag2 tag3 tag4) do |tag, css_class| %>
          <%= link_to "#{tag.name}", {:controller=>:tags, :action=>:filter, :tags => "loudness:#{tag.name}"}, :class => css_class, :title=>"#{tag.count} tags" %>,
        <% end
      end %></p>
    </p>
    <p/>
    <p>
      <img src="/images/icons/calendar-date-32x32.png" align="absmiddle" alt="Average day"/>&nbsp;<b><%= t 'cartasur.users.show.dailynoiseexposure' %>: </b><br/><br/>
      <%= t 'cartasur.users.show.noimage' %>
      <% #<img src="/api/timedist_extended.png?user=<%= @user.id
          %>
    </p>
    <p>
        <div id="Topics">
          <img src="/images/icons/forum-topic.png" style="width: 32px; height:32px;" align="absmiddle" alt="User posts"/>&nbsp;<b><%=   t 'cartasur.forums.posts.userposts'%></b><br/><br/>
            <% unless @user.topics.blank?
                 @user.topics.each do |topic| %>
                    <%= link_to topic.name, cartasur_forum_topic_url(topic.forum, topic) %>,
                <% end
                else %>
                <p><%=  t 'cartasur.forums.topics.notopics' %></p>
            <% end %>
        </div>
    </p>
  </div>
</div>
<div>
  <b style="font-size:16px"><%= t 'cartasur.users.show.timeline' %>:</b> <b style="font-size:14px"><%= @user.tracks.count  %> <%= t 'cartasur.users.show.digitaltraces' %></b> <!-- <a href="<%= user_url(@user, :format=>:rss)  %>"><img src="/images/icons/georss.png" align="absmiddle" alt="GeoRSS"/></a>  -->
  <% if flash[:notice] %>
      <div style="color: #a11328; text-align: center; font-style: italic; font-size: 14px;" ><%= flash[:notice] %></div>
  <% end %>

  <%= render :partial => "track_list" %>
</div>
